import { IPSDERGroup } from './ipsdergroup';
import { IPSDERGroupDetail } from './ipsdergroup-detail';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDERGroupImpl extends PSModelObjectImpl implements IPSDERGroup {
  get codeName(): string {
    return this.M.codeName;
  }

  get codeName2(): string {
    return this.M.codeName2;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get extendMode(): 0 | 2 {
    return this.M.extendMode != null ? this.M.extendMode : 0;
  }

  get groupTag(): string {
    return this.M.groupTag;
  }

  get groupTag2(): string {
    return this.M.groupTag2;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  get orderValue(): number {
    return this.M.orderValue != null ? this.M.orderValue : 99999;
  }

  protected psdergroupdetails: IPSDERGroupDetail[] | null = null;

  getPSDERGroupDetails(): IPSDERGroupDetail[] | null {
    if (this.psdergroupdetails == null) {
      this.psdergroupdetails = this.fillChildListModel(this.M.getPSDERGroupDetails, 'dataentity.der.IPSDERGroupDetail') as IPSDERGroupDetail[];
    }
    return this.psdergroupdetails;
  }

  get psDERGroupDetails(): IPSDERGroupDetail[] | null {
    return this.getPSDERGroupDetails();
  }

  findPSDERGroupDetail(objKey: any): IPSDERGroupDetail | null {
    return this.getPSModel5('dataentity.der.IPSDERGroupDetail', this.getPSDERGroupDetails(), objKey) as IPSDERGroupDetail;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get cls(): string {
    return 'PSDERGroupImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'IPSModelSortable' || cls == 'dataentity.der.IPSDERGroup') return true;
    return super.instanceof(cls);
  }
}
